<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<script src="//cdn.bootcss.com/angular.js/1.6.0/angular.min.js"></script>

	<script type="application/javascript">
		var app = angular.module('app', []);
		app.controller('LoginController', function($rootScope, $scope, $http) {
			$scope.message = '';
			$scope.account = '';
			$scope.password = '';

			$scope.login = function() {
				$scope.message = '';
				$http({
					url: '/loginPost',
					method: 'POST',
					//					data: 'account=' + $scope.account + '&password=' +
					//						$scope.password
					params: {
						account: $scope.account,
						password: $scope.password
					}
				}).then(function(r) {
					if(r.data.success=='false') {
						$scope.message = r.data.message;
						return;
					}
					window.location.href = '/';
				}, function(r) {
					
				});
			}

		});
	</script>

	<style type="text/css">
		.login-form {
			top: 200px;
			width: 350px;
			height: 315px;
			position: relative;
			margin: auto;
		}
		
		.login-form div {
			margin-top: 15px;
		}
		
		.login-form .my-input {
			display: block;
			width: 256px;
			height: 34px;
			border: 1px solid #BBBBBB;
		}
		
		.login-form .my-button {
			width: 260px;
			height: 40px;
			display: block;
			margin-top: 20px;
			background-color: #169BD5;
			border: 0px;
			color: #FFFFFF;
		}
		
		.login-form .my-button:hover {
			cursor: pointer;
		}
		
		.login-form * {
			position: relative;
			margin: auto;
		}
	</style>

	<body ng-app="app" ng-controller="LoginController">
		<form class="login-form">
			<div style="font-size: 48px; text-align: center;color:#169BD5 ;">
				口袋管家
			</div>
			<div style="font-size: 18px;text-align:center;">
				让&nbsp;数&nbsp;据&nbsp;为&nbsp;你&nbsp;所&nbsp;用
			</div>
			<div style="height: 30px;width: 260px;margin-top: 0;color: red;font-size: 10px;line-height: 30px;">
				{{message}}
			</div>
			<input class="my-input" style="border-bottom:0 " type="text" name="" placeholder="用户名" ng-model="account" />
			<input class="my-input" type="password" placeholder="密码" ng-model="password" />

			<input class="my-button" type="button" value="登录" ng-click="login()" />

		</form>
	</body>

</html>